package com.shujia.day03;

public class Demo13ArrayPrint {
    public static void main(String[] args) {
        int[] strArr = {1, 2, 3, 3, 2, 1, 4, 5, 6};
        // [1, 2, 3, 3, 2, 1, 4, 5, 6]
        System.out.println(getArrStr(strArr));
    }

    public static String getArrStr(int[] strArr) {
        String arrStr = "[";
        for (int i = 0; i < strArr.length; i++) {
            if (i != strArr.length - 1) {
                arrStr += strArr[i] + ", ";
            }else {
                arrStr += strArr[i];
            }
        }
        arrStr += "]";
        return arrStr;
    }
}
